<?php

namespace p5\objects;

/**
 * Created by PhpStorm.
 * User: simon
 * Date: 2015/11/23
 * Time: 9:49
 */
class JsUtils
{
    public static function parent_go($url)
    {
        self::render_js("parent.go_url('$url') ;");
    }

    public static function go_url($url)
    {
        self::render_js("go_url('$url');");
    }

    public static function render_js($info)
    {
        echo "<script language='javascript'>\n";
        echo "$info \n";
        echo "</script>\n";
    }

    public static function js_alert($info)
    {
        self::render_js("alert(\"$info\");");
    }
}